package com.github.codemperor.core.logger.test.mr.wordcount;

import com.github.codemperor.core.logger.BaseLogger;
import com.github.codemperor.core.logger.compute.Context;
import com.github.codemperor.core.logger.compute.IMapperStreamingFunction;

import java.util.List;

public class WordCountMapper implements IMapperStreamingFunction {
    @Override
    public void mapping(Object line, Context context) {
        List<String> lineList = BaseLogger.resolver((String) line);

        lineList.forEach(l -> context.map(l, 1));
    }
}
